package cc.fs.zhihuapp.ui.base;

import android.app.Fragment;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.view.View;

/**
 * Created by fostion on 2015/9/7.
 */
public abstract class BaseFragment extends Fragment {

    private ProgressDialog waitDialog;

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        //设置dialog
        setUpWaitDialog();
    }

    public void setUpWaitDialog(){
        waitDialog = new ProgressDialog(getActivity());
        waitDialog.setMessage("正在加载...");
        waitDialog.setCancelable(false);
    }

    public void showWaitProress() {
        if(waitDialog != null && !waitDialog.isShowing()){
            waitDialog.show();
        }
    }

    public void hiddenWaitProgress(){
        if(waitDialog != null && waitDialog.isShowing()){
            waitDialog.dismiss();
        }
    }
}
